/*
 * @Author: qin
 * @Date:   2018-08-28
 * +----------------------------------------------------------------------
 * | admin [ 后台管理系统公共配置信息 ]
 * | 建设单位成果确认相关接口模块
 * +----------------------------------------------------------------------
 */
layui.define(['jquery', 'configure', 'configureCom', 'bluebird'], function (exports) {
    var configure = layui.configure;
    var configureCom = layui.configureCom;
    var gain = {
        param: {
            resultId: -1,
            resultType: 0,
            data: {}
        },
        surveyGainConfirm: function (data) { // 单位工程勘察成果确认
            return new Promise(function (resolve, reject) {
                configureCom.putDataAjax(configure.SURVEY_GAIN_CONFIRM_HTTP, data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        surveyGainUnConfirm: function (data) {
            //勘察单位工程成果取消确认
            return new Promise(function (resolve, reject) {
                configureCom.putDataAjax(configure.SURVEY_GAIN_UN_CONFIRM_HTTP, data).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        designGainConfirm: function (data) { // 单位工程设计成果确认
            return new Promise(function (resolve, reject) {
                configureCom.putAjax(configure.DESIGN_GAIN_CONFIRM_HTTP, JSON.stringify(data)).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        },
        designGainUnConfirm: function (data) {
            //单位工程设计成果取消确认
            return new Promise(function (resolve, reject) {
                configureCom.putAjax(configure.DESIGN_GAIN_UN_CONFIRM_HTTP, JSON.stringify(data)).then(function (res) {
                    resolve(res);
                }, function (err) {
                    reject(err);
                });
            });
        }
    };
    exports('gain', gain);
});